import _ from 'lodash';
import {setUserInfo, setTitle, to, execFn, getToken, getLsJson, setLsJson} from '@jzl/utils';
import { api, sapi } from '@jzl/api'
import { useCommonStore } from "@jzl/stores";

// const ACCOUNT_HISTORY = "accountHistory";

export const setPageTitle = (title) => {
  let sysName = useCommonStore().project?.project_name;
  let showTitle = (title && sysName) ? `${ title } | ${ sysName }`: (title || sysName);

  setTitle(showTitle)
}
/*

export const getAccountHistory = () => {
  return getLsJson(ACCOUNT_HISTORY);
}

export const setAccountHistory = (account) => {
  let accounts = getAccountHistory();

  if(!accounts || !_.isArray(accounts)) {
    accounts = [];
  }
  console.log(accounts, account)
  if(_.indexOf(accounts, account) < 0) {
    accounts.push(account);
    setLsJson(ACCOUNT_HISTORY, accounts);
  }
}
*/
